///
///  photo_view_demo.dart
///  create by zmtzawqlp on 2019/4/4
import 'package:extended_image/extended_image.dart';
import 'package:flutter/material.dart' hide CircularProgressIndicator;

import '../hero_image/hero_image_hint_widget.dart';

class ImageOverlayViewDemo extends StatefulWidget {
  ImageOverlayViewDemo();

  @override
  _ImageOverlayViewDemoState createState() => _ImageOverlayViewDemoState();
}

class _ImageOverlayViewDemoState extends State<ImageOverlayViewDemo> {
  String imageUrl = 'https://photo.tuchong.com/14649482/f/601672690.jpg';

  Widget get contentImage => ExtendedImage.network(imageUrl);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('OverlayEntry Demo'),
      ),
      body: Container(
        padding: const EdgeInsets.all(16),
        child: Column(
          children: [
            const SizedBox(
              height: 100,
            ),
            Padding(
              padding: EdgeInsets.all(100),
              child: ImageHintWidget(contentImage),
            ),
            const SizedBox(
              height: 64,
            ),
            MaterialButton(
              shape: RoundedRectangleBorder(
                  side: BorderSide(color: Theme.of(context).primaryColor),
                  borderRadius: BorderRadius.circular(32)),
              color: Theme.of(context).primaryColor,
              textColor: Colors.white,
              child: Text('Remove Focus'),
              onPressed: () {
                FocusScope.of(context).unfocus();
              },
            )
          ],
        ),
      ),
    );
  }
}
